﻿using System;
using System.Web.Security;

public partial class RolesManage_ViewUserOnline : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Label1.Text = Membership.GetNumberOfUsersOnline().ToString();
        BindUsersOnline();
    }

    protected void BindUsersOnline()
    {
        MembershipUserCollection muc = new MembershipUserCollection();
        foreach (MembershipUser u in Membership.GetAllUsers())
        {
            if (u.IsOnline == true)
                muc.Add(u);
        }
        this.GridView1.DataSource = muc;
        this.GridView1.DataBind();
    }
}
